// app.js
App({ 
	request(obj){ // obj={ url, timeout, data, header, ...}
		return new Promise((resolve,reject)=>{
			wx.request({
				...obj,
				complete: r => {
					if (r.errMsg == "request:ok" && r.data) {
						resolve(r.data)
					} else {
						resolve(null)
					}
				}
			})
		})
	},
})